// index.ts
// 获取应用实例
const app = getApp<IAppOption>()
const apiurl = app.globalData.serverurl
const apilist = app.globalData.apiList
const apiPost = app.apiPost
Page({
  data: {
    apiurl: apiurl
  },
  getarticle() {
    let that = this
    let { article } = apilist
    apiPost(article, '', function (res: any) {
      if (res.code == 1) {
        that.setData({
          catelist: res.data
        })
      }
    })
  },
  goContent(e: object) {
    wx.navigateTo({
      url: "../../pages/content/content?id=" + e.currentTarget.dataset.id,
      routeType: 'wx://zoom'
    })
  },
  onLoad() {
    this.getarticle()
  },
  onShareAppMessage: function () {
    return {
      title: '云拾贰',
      path: '/pages/index/index',
    }
  },
})
